package com.wkbb.basic.thread;

import com.wkbb.basic.feign.TcCloudFeignService;
import com.wkbb.common.enums.ImGroupTypeEnum;
import lombok.extern.slf4j.Slf4j;

/**
 * @author dengjingyuan
 * @date 2020-02-28 18:00
 */
@Slf4j
public class ImUpdateGroupInfoTask implements Runnable  {

    private Long classId;

    private Long orgId;

    private String className;

    private Short imGroupTyp;

    private TcCloudFeignService tcCloudFeignService;

    public ImUpdateGroupInfoTask(Long classId,Long orgId, String className,Short imGroupTyp, TcCloudFeignService tcCloudFeignService) {
        this.orgId = orgId;
        this.classId = classId;
        this.className = className;
        this.imGroupTyp = imGroupTyp;
        this.tcCloudFeignService = tcCloudFeignService;
    }

    public ImUpdateGroupInfoTask() {

    }

    @Override
    public void run() {
        log.info("*********ImUpdateGroupInfoTask********classId:{},orgId:{},className:{},imGroupTyp:{},tcCloudFeignService:{}",  classId, orgId,  className, imGroupTyp, tcCloudFeignService);
        try {

            log.info("----------准备开启修改IM群名称线程--------classId:{},orgId:{},className:{},imGroupTyp:{},tcCloudFeignService:{}",  classId, orgId,  className, imGroupTyp, tcCloudFeignService);
            tcCloudFeignService.updateGroupInfo(classId, orgId, className , imGroupTyp);
        } catch (Exception e) {
            log.error("*******ImUpdateGroupInfoTask**********", e);
        }
    }
}
